package com.yc.controller;


import com.yc.entity.Detail;
import com.yc.service.DetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/detail")
public class DetailController {
    @Autowired
    private DetailService detailService;

    /**
     * 查询钱包明细
     * @param userId
     * @return
     */
    @GetMapping("/getDetails/{userId}")
    public List<Detail> getDetails(@PathVariable("userId") Integer userId){
        List<Detail> list = detailService.getDetails(userId);
        return list;
    }
}

